package com.traffic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.traffic.mapper.PerGiftManagementMapper;
import com.traffic.domain.PerGiftManagement;
import com.traffic.service.IPerGiftManagementService;

/**
 * 礼品管理Service业务层处理
 * 
 * @author 郭世纪
 * @date 2024-12-08
 */
@Service
public class PerGiftManagementServiceImpl implements IPerGiftManagementService 
{
    @Autowired
    private PerGiftManagementMapper perGiftManagementMapper;

    /**
     * 查询礼品管理
     * 
     * @param relativeId 礼品管理主键
     * @return 礼品管理
     */
    @Override
    public PerGiftManagement selectPerGiftManagementByRelativeId(Long relativeId)
    {
        return perGiftManagementMapper.selectPerGiftManagementByRelativeId(relativeId);
    }

    /**
     * 查询礼品管理列表
     * 
     * @param perGiftManagement 礼品管理
     * @return 礼品管理
     */
    @Override
    public List<PerGiftManagement> selectPerGiftManagementList(PerGiftManagement perGiftManagement)
    {
        return perGiftManagementMapper.selectPerGiftManagementList(perGiftManagement);
    }

    /**
     * 新增礼品管理
     * 
     * @param perGiftManagement 礼品管理
     * @return 结果
     */
    @Override
    public int insertPerGiftManagement(PerGiftManagement perGiftManagement)
    {
        return perGiftManagementMapper.insertPerGiftManagement(perGiftManagement);
    }

    /**
     * 修改礼品管理
     * 
     * @param perGiftManagement 礼品管理
     * @return 结果
     */
    @Override
    public int updatePerGiftManagement(PerGiftManagement perGiftManagement)
    {
        perGiftManagement.setUpdateTime(DateUtils.getNowDate());
        return perGiftManagementMapper.updatePerGiftManagement(perGiftManagement);
    }

    /**
     * 批量删除礼品管理
     * 
     * @param relativeIds 需要删除的礼品管理主键
     * @return 结果
     */
    @Override
    public int deletePerGiftManagementByRelativeIds(Long[] relativeIds)
    {
        return perGiftManagementMapper.deletePerGiftManagementByRelativeIds(relativeIds);
    }

    /**
     * 删除礼品管理信息
     * 
     * @param relativeId 礼品管理主键
     * @return 结果
     */
    @Override
    public int deletePerGiftManagementByRelativeId(Long relativeId)
    {
        return perGiftManagementMapper.deletePerGiftManagementByRelativeId(relativeId);
    }
}
